<?php

class PDODB{


	private $conn;

	private $stmt;

	public function __construct(){

		try {
			    $this->conn = new PDO('mysql:host=localhost;dbname=datn1415','root','vertrigo');
			    $this->conn->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
		} catch(PDOException $e) {
			    echo 'ERROR: Cannot connect to your database ' . $e->getMessage();
		}

	}

	public function Query($sql,array $list){

		try{

		$this->stmt = $this->conn->prepare($sql);

		$this->stmt->execute($list);

		} catch(PDOException $e){
			throw new ExceptionManager($e->getMessage());
		}
	}

	public function Fetch(){
		return $this->stmt->fetchAll();
	}





}



?>